import {Dimensions, StyleSheet} from "react-native";
import {
    fontSize_10,
    fontSize_11,
    fontSize_12,
    fontSize_13,
    fontSize_14,
    fontSize_15,
    fontSize_16,
    fontSize_20,
    fontSize_25
} from "../theme";

const {width,height,scale} = Dimensions.get("window");
const backgroundColorList = ["#2181fc","#8ed0e3","#c5a798","#e59d62"]
export const getBackgroundColor = (index:number|string) => {
    index = Number(index);
    while (index > backgroundColorList.length -1)
    {
        index = index - backgroundColorList.length;
    }
    return {backgroundColor:backgroundColorList[index]};
}
export const cs = StyleSheet.create({
    container_R10_White: {
        flex: 1,
        width: width,
        alignItems: "center",
        flexDirection: "column",
        paddingLeft: 20,
        paddingRight: 10,
        paddingTop:10,
        backgroundColor: "white"
    },
    f1:{flex:1},
    f2:{flex:2},
    f3:{flex:3},
    f4:{flex:4},
    f5:{flex:5},
    //flexDirection
    fdRow:{flexDirection:"row"},
    //alignItems justifyContent
    ac:{alignItems:"center"},
    jc:{justifyContent:"center"},
    jsb:{justifyContent:"space-between"},
    //overflow
    over_hidden:{overflow:"hidden"},
    //padding
    p0:{padding:0},
    pt0:{paddingTop:0},
    pb0:{paddingBottom:0},
    pl0:{paddingLeft:0},
    pr0:{paddingRight:0},
    p5:{padding:5},
    pt5:{paddingTop:5},
    pb5:{paddingBottom:5},
    pl5:{paddingLeft:5},
    pr5:{paddingRight:5},
    p10:{padding:10},
    pt10:{paddingTop:10},
    pb10:{paddingBottom:10},
    pl10:{paddingLeft:10},
    pr10:{paddingRight:10},
    p15:{padding:15},
    pt15:{paddingTop:15},
    pb15:{paddingBottom:15},
    pl15:{paddingLeft:15},
    pr15:{paddingRight:15},
    p20:{padding:20},
    pt20:{paddingTop:20},
    pb20:{paddingBottom:20},
    pl20:{paddingLeft:20},
    pr20:{paddingRight:20},
    //borderRadius
    borderRadioHalf:{borderRadius:999999},
    //color
    c_w:{color:"white"},
    //margin
    m5:{margin:5},
    mt5:{marginTop:5},
    mb5:{marginBottom:5},
    ml5:{marginLeft:5},
    mr5:{marginRight:5},
    m10:{margin:10},
    mt10:{marginTop:10},
    mb10:{marginBottom:10},
    ml10:{marginLeft:10},
    mr10:{marginRight:10},
    m15:{margin:15},
    mt15:{marginTop:15},
    mb15:{marginBottom:15},
    ml15:{marginLeft:15},
    mr15:{marginRight:15},
    m20:{margin:20},
    mt20:{marginTop:20},
    mb20:{marginBottom:20},
    ml20:{marginLeft:20},
    mr20:{marginRight:20},
    //width  height
    w_100:{width:"100%"},
    h_100:{height:"100%"},
    w_w:{width:width},
    h_h:{height:height},
    //position
    p_abs:{position:"absolute"},
    p_re:{position:"relative"},
    //textAlign textAlignVertical
    ta_c:{textAlign:"center"},
    ta_l:{textAlign:"left"},
    ta_r:{textAlign:"right"},
    tav_c:{textAlignVertical:"center"},
    tav_t:{textAlignVertical:"top"},
    tav_b:{textAlignVertical:"bottom"},
    //fontSize
    fs_10:{fontSize:fontSize_10},
    fs_11:{fontSize:fontSize_11},
    fs_12:{fontSize:fontSize_12},
    fs_13:{fontSize:fontSize_13},
    fs_14:{fontSize:fontSize_14},
    fs_15:{fontSize:fontSize_15},
    fs_16:{fontSize:fontSize_16},
    fs_20:{fontSize:fontSize_20},
    fs_25:{fontSize:fontSize_25},
    //letterSpacing
    ls_half_0:{letterSpacing:0.5},
    ls_1:{letterSpacing:1},
    ls_half_1:{letterSpacing:1.5},
    //top bottom left right
    t_half:(height:number)=>{
        return { top:"50%",transform:[{translateY:-1*height*0.5}] }
        },
    l_half:(width:number)=>{
        return { left:"50%",transform:[{translateX:-1*width*0.5}] }
        },
    l5:{left:5},
    r5:{right:5},
    t5:{top:5},
    b5:{bottom:5},
    l10:{left:10},
    r10:{right:10},
    t10:{top:10},
    b10:{bottom:10},
    l20:{left:20},
    r20:{right:20},
    t20:{top:20},
    b20:{bottom:20},
    //borderWidth
    bw_1:{borderWidth:1},
    bw_1s:{borderWidth:1/scale},
    bw_2:{borderWidth:2},
    bw_2s:{borderWidth:2/scale},
    bw_5:{borderWidth:5},
    bw_5s:{borderWidth:5/scale},

    btw_1:{borderTopWidth:1},
    btw_1s:{borderTopWidth:1/scale},
    btw_2:{borderTopWidth:2},
    btw_2s:{borderTopWidth:2/scale},
    btw_5:{borderTopWidth:5},
    btw_5s:{borderTopWidth:5/scale},

    bbw_1:{borderBottomWidth:1},
    bbw_1s:{borderBottomWidth:1/scale},
    bbw_2:{borderBottomWidth:2},
    bbw_2s:{borderBottomWidth:2/scale},
    bbw_5:{borderBottomWidth:5},
    bbw_5s:{borderBottomWidth:5/scale},

    blw_1:{borderLeftWidth:1},
    blw_1s:{borderLeftWidth:1/scale},
    blw_2:{borderLeftWidth:2},
    blw_2s:{borderLeftWidth:2/scale},
    blw_5:{borderLeftWidth:5},
    blw_5s:{borderLeftWidth:5/scale},

    brw_1:{borderRightWidth:1},
    brw_1s:{borderRightWidth:1/scale},
    brw_2:{borderRightWidth:2},
    brw_2s:{borderRightWidth:2/scale},
    brw_5:{borderRightWidth:5},
    brw_5s:{borderRightWidth:5/scale},

    //backgroundColor
    bgc_w:{backgroundColor:"white"},
    bgc_b:{backgroundColor:"black"},


})
